package com.googlethemebuilder;

/**
 * 
 * @author hong
 * themes metadata
 *
 *<ConfigMap type="Skin">
 	<Meta name="title">The Theme's title</Meta>
    <Meta name="description">A description about my theme, how it changes over time, etc.</Meta>
    <Meta name="author">Author's name</Meta>
    <Meta name="author_email">info@mysite.com</Meta>
    <Meta name="thumbnail">http://www.mysite.com/theme/thumbnail410x70.jpg</Meta>
    <Meta name="screenshot">http://www.mysite.com/theme/screenshot680x116.jpg</Meta>
	</ConfigMap>    
 */
public class Metadata {

	// TODO: validations for each field
	
	private String title;
	private String description;
	private String author;
	private String authorEmail;
	private String thumbnail;
	private String screenshot;
		
	public Metadata() {}
	
	public Metadata(String title, String description, String author,
			String authorEmail, String thumbnail, String screenshot) {
		super();
		this.title = title;
		this.description = description;
		this.author = author;
		this.authorEmail = authorEmail;
		this.thumbnail = thumbnail;
		this.screenshot = screenshot;
	}
	
	public String toXML() {
		StringBuilder sb = new StringBuilder();
		sb.append("<ConfigMap type=\"Skin\">");
		sb.append("<Meta name=\"title\">").append(this.title).append("</Meta>");
		sb.append("<Meta name=\"description\">").append(this.description).append("</Meta>");
		sb.append("<Meta name=\"author\">").append(this.author).append("</Meta>");
		sb.append("<Meta name=\"author_email\">").append(this.authorEmail).append("</Meta>");
		sb.append("<Meta name=\"thumbnail\">").append(this.thumbnail).append("</Meta>");
		sb.append("<Meta name=\"screenshot\">").append(this.screenshot).append("</Meta>");
		sb.append("</ConfigMap>");
		return sb.toString();
	}
	
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getAuthor() {
		return author;
	}
	public void setAuthor(String author) {
		this.author = author;
	}
	public String getAuthorEmail() {
		return authorEmail;
	}
	public void setAuthorEmail(String authorEmail) {
		this.authorEmail = authorEmail;
	}
	public String getThumbnail() {
		return thumbnail;
	}
	public void setThumbnail(String thumbnail) {
		this.thumbnail = thumbnail;
	}
	public String getScreenshot() {
		return screenshot;
	}
	public void setScreenshot(String screenshot) {
		this.screenshot = screenshot;
	}
}
